
<template>
    <div class="wf_dialog-box">
        <el-dialog 
        :title="dialogData.title" 
        :visible.sync="dialogData.dialogVisible"
        :size="dialogData.size"
        :modal='dialogData.modal'
        :close-on-click-modal="false"
        >
            <slot name="body"></slot>
            <div slot="footer" class="dialog-footer">
                <el-button @click="dialogData.dialogVisible = false" v-if="dialogData.btnLeft" >{{ dialogData.btnLeft}}</el-button>
                <el-button type="primary" @click="submitForm" v-if="dialogData.btnRight" >{{ dialogData.btnRight}}</el-button>
            </div>
        </el-dialog>
    </div>
</template>


<script>
  export default {
    props: {
        dialogData: {
            size: {
                default: 'small'
            },
            formLabelWidth: {
                default: '120px'
            },
            dialogVisible: {
                default:  false
            },
            btnLeft: {
                default: '取 消'
            },
            btnRight: {
                default: '提 交'
            },
            modal: {
                default: true
            },
            title: {
                default: '新增'
            }
        }
    },
        
    data() {
      return {}
    },
    methods: {
        submitForm() {
            this.$emit('submitForm', this.dialogData.title)
        }

    }
  };
</script>

<style lang='scss'>
   .wf_dialog-box {
       .el-input {
           width: 240px;
       }
   }
</style>
